import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutterapp1/color/MyColor.dart';

class ATFavListItem extends StatelessWidget{
  ATFavListItem({Key key, this.title,this.subTitle,this.url,this.onTap}) : super(key: key);
  final String title;
  final String subTitle;
  final String url;
  final GestureTapCallback onTap;
  @override
  Widget build(BuildContext context) {
    var width =  ScreenUtil.screenWidthDp;
    var height = 120.0;
    return Container(
      width: width,
      height: height,
      child: new GestureDetector(
        child: new Stack(
          children: <Widget>[
            new Container(
              margin: EdgeInsets.only(top:15,left: 15),
              width: 80,
              height: 105,
              child: Image.network(url, fit: BoxFit.cover),
            ),
            new Container(
              margin: EdgeInsets.only(top:25,left:110),
              child: Text(title),
            ),
            new Container(
              margin: EdgeInsets.only(top:55,left:110),
              child: Text(subTitle),
            ),
          ],
        ),
        onTap: onTap,
      ),
    );
  }
}